﻿using System;
using System.Linq;
using System.Runtime.CompilerServices;
using AutoR.Helpers;
using AutoR.Services;
using Newtonsoft.Json;
using Prism.Mvvm;

namespace AutoR.Models
{
	// Token: 0x020001E1 RID: 481
	public class Tactic : BindableBase
	{
		// Token: 0x170002AC RID: 684
		// (get) Token: 0x06000A0A RID: 2570 RVA: 0x0006B2CA File Offset: 0x000694CA
		// (set) Token: 0x06000A0B RID: 2571 RVA: 0x0006B2D4 File Offset: 0x000694D4
		public int boat_id
		{
			[CompilerGenerated]
			get
			{
				return this.<boat_id>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<boat_id>k__BackingField == value)
				{
					return;
				}
				this.<boat_id>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Ship);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Image);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.boat_id);
			}
		}

		// Token: 0x170002AD RID: 685
		// (get) Token: 0x06000A0C RID: 2572 RVA: 0x0006B317 File Offset: 0x00069517
		// (set) Token: 0x06000A0D RID: 2573 RVA: 0x0006B320 File Offset: 0x00069520
		public int cid
		{
			[CompilerGenerated]
			get
			{
				return this.<cid>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<cid>k__BackingField == value)
				{
					return;
				}
				this.<cid>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.cid);
			}
		}

		// Token: 0x170002AE RID: 686
		// (get) Token: 0x06000A0E RID: 2574 RVA: 0x0006B34D File Offset: 0x0006954D
		// (set) Token: 0x06000A0F RID: 2575 RVA: 0x0006B358 File Offset: 0x00069558
		public int level
		{
			[CompilerGenerated]
			get
			{
				return this.<level>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<level>k__BackingField == value)
				{
					return;
				}
				this.<level>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.IsFullLevel);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.level);
			}
		}

		// Token: 0x170002AF RID: 687
		// (get) Token: 0x06000A10 RID: 2576 RVA: 0x0006B390 File Offset: 0x00069590
		// (set) Token: 0x06000A11 RID: 2577 RVA: 0x0006B398 File Offset: 0x00069598
		public int exp
		{
			[CompilerGenerated]
			get
			{
				return this.<exp>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<exp>k__BackingField == value)
				{
					return;
				}
				this.<exp>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.IsFullLevel);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.exp);
			}
		}

		// Token: 0x170002B0 RID: 688
		// (get) Token: 0x06000A12 RID: 2578 RVA: 0x0006B3D0 File Offset: 0x000695D0
		// (set) Token: 0x06000A13 RID: 2579 RVA: 0x0006B3D8 File Offset: 0x000695D8
		[JsonConverter(typeof(BoolConverter))]
		public bool status
		{
			[CompilerGenerated]
			get
			{
				return this.<status>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<status>k__BackingField == value)
				{
					return;
				}
				this.<status>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.status);
			}
		}

		// Token: 0x170002B1 RID: 689
		// (get) Token: 0x06000A14 RID: 2580 RVA: 0x0006B405 File Offset: 0x00069605
		// (set) Token: 0x06000A15 RID: 2581 RVA: 0x0006B410 File Offset: 0x00069610
		public int position
		{
			[CompilerGenerated]
			get
			{
				return this.<position>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<position>k__BackingField == value)
				{
					return;
				}
				this.<position>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.position);
			}
		}

		// Token: 0x170002B2 RID: 690
		// (get) Token: 0x06000A16 RID: 2582 RVA: 0x0006B43D File Offset: 0x0006963D
		// (set) Token: 0x06000A17 RID: 2583 RVA: 0x0006B448 File Offset: 0x00069648
		public int tactics_id
		{
			[CompilerGenerated]
			get
			{
				return this.<tactics_id>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<tactics_id>k__BackingField == value)
				{
					return;
				}
				this.<tactics_id>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Name);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.tactics_id);
			}
		}

		// Token: 0x170002B3 RID: 691
		// (get) Token: 0x06000A18 RID: 2584 RVA: 0x0006B480 File Offset: 0x00069680
		public string Name
		{
			get
			{
				return Runtime.Configs.ShipTactics.SingleOrDefault((ShipTactics i) => i.tacticsId == this.tactics_id).title;
			}
		}

		// Token: 0x170002B4 RID: 692
		// (get) Token: 0x06000A19 RID: 2585 RVA: 0x0006B4A2 File Offset: 0x000696A2
		public UserShip Ship
		{
			get
			{
				return Runtime.Game.UserShip.SingleOrDefault((UserShip i) => i.id == this.boat_id);
			}
		}

		// Token: 0x170002B5 RID: 693
		// (get) Token: 0x06000A1A RID: 2586 RVA: 0x0006B4BF File Offset: 0x000696BF
		public string Image
		{
			get
			{
				UserShip ship = this.Ship;
				if (ship == null)
				{
					return null;
				}
				return ship.SmallImage;
			}
		}

		// Token: 0x170002B6 RID: 694
		// (get) Token: 0x06000A1B RID: 2587 RVA: 0x0006B4D2 File Offset: 0x000696D2
		public bool IsFullLevel
		{
			get
			{
				return this.level == 3 && this.exp == 500;
			}
		}
	}
}
